$(function () {

    var myDate= new Date();
    var startYear=myDate.getFullYear()-50;//起始年份
    var endYear=myDate.getFullYear()+50;//结束年份
    var yearSelect=document.getElementById('choseYear_projectManage');
    for (var i=startYear;i<=endYear;i++)
    {
        var option=document.createElement("option");
        option.text=" "+i+'年';
        try{
            // 对于更早的版本IE8
            yearSelect.add(option,yearSelect.options[null]);
        }catch (e){
            yearSelect.add(option,null);
        }
        // yearSelect.options.add(new Option(i,i)+'年');
    }
    yearSelect.options[yearSelect.options.length-51].selected=1;

    //标签页切换操作
    var tab=document.getElementsByClassName('tabNavigation')[0];
    EventUtil.addHandler(tab,"click",function (event) {
        event=EventUtil.getEvent(event);
        var target=EventUtil.getTarget(event);
        // console.log($('.projectALLContent').hasClass('active'))
        switch (target.id){
            case "itemAll":
                if(!$(target).parent().hasClass('active')){
                    $(target).parent().siblings().removeClass('active');
                    $(target).parent().addClass('active');
                }
                if(!$('.projectALLContent').hasClass('active')){
                    $('.projectALLContent').addClass('active');
                    $('.projectALLContent').siblings().removeClass('active');
                }
                break;
            case "itemEstablished":
                // console.log(1)
                // console.log($(target).parent())
                if(!$(target).parent().hasClass('active')){
                    $(target).parent().siblings().removeClass('active');
                    $(target).parent().addClass('active');
                }
                if(!$('.projectEstablishedContent').hasClass('active')){
                    $('.projectEstablishedContent').addClass('active');
                    $('.projectEstablishedContent').siblings().removeClass('active');
                }
                break;
            case "itemFinished":
                if(!$(target).parent().hasClass('active')){
                    // console.log(1)
                    // console.log($(target).parent());
                    $(target).parent().siblings().removeClass('active');
                    $(target).parent().addClass('active');
                    // console.log($(target).parent());
                }
                if(!$('.projectFinishedContent').hasClass('active')){
                    $('.projectFinishedContent').addClass('active');
                    $('.projectFinishedContent').siblings().removeClass('active');
                }
                break;
        }
    })
})